/**
\file Commandset3.qml
\brief Button toolbar: Command set 3

The toolbars are numbered from left to right as the order that appears
on the screen.

\todo Set a standard name for every button Id

\author © 2011 Enrico Miglino / Tech Consulting (enrico.miglino@ovi.com)
\author "Black Cat Cutting Studio" is protected by the copyright law
\author Distributed under the LGPL 3.0 license.
\version 1.0 alpha
\date 2011

\par Black Cat Cutting Studio licensing notes

    "Black Cat Cutting Studio" is free software: you can redistribute it
    and/or modify it under the terms of the Lesser GNU General Public License
    as published by the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    "Black Cat Cutting Studio" is distributed in the hope that it
    will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    Lesser GNU General Public License for more details.

    You should have received a copy of the Lesser GNU General Public License
    along with "Black Cat Cutting Studio".
    If not, see <http://www.gnu.org/licenses/>.

*/
import QtQuick 1.0

Item {
    id: toolbar    // Options toolbar for the user setup

    // Relative position settings
    property int btnMargin: 2       // Buttons margins
    property int buttonSize: 36
    property int btnNumber: 3   // Number of buttons

    // Arbitrary position. The toolbar is translated to the right position
    // when instantiated.
    x: 100
    y: 10

    width: btnMargin + (buttonSize + btnMargin) * btnNumber;
    height: buttonSize + btnMargin * 2

    // Signals for all the buttons
    signal button1Clicked
    signal button2Clicked
    signal button3Clicked

    focus:true

    // Toolbar backgroun
    Rectangle {
        id: background
        width: parent.width; height: parent.height
        color: "white"
        border.color: "darkgrey"
        border.width: 2
        smooth: true; radius: 5
    }

    // Tiled image to fill the toolbar area
    Image {
        id: tiledGraphics

        width: parent.width
        height: parent.height
        // fillMode is set to tiled, to repeat on all the filled area.
        fillMode: Image.Tile
        // The image source file (base element to tile)
        source: "../images/background.svg"
    }

    // -------------------------------------------- Buttons definition
    Button {
        id: btn_new

        icon: "../images/btn_zoomout.png"
        height: buttonSize; width: buttonSize
        onClicked: toolbar.button1Clicked(); // Event function callback
        x: btnMargin; y: btnMargin
        focus:true
    }

    Button {
        id: btn_edit

        icon: "../images/btn_zoom.png"
        height: buttonSize; width: buttonSize
        onClicked: toolbar.button2Clicked(); // Event function callback
        anchors.left: btn_new.right
        anchors.margins: btnMargin
        anchors.top: parent.top
        anchors.topMargin: btnMargin
    }

    Button {
        id: btn_pack

        icon: "../images/btn_zoomin.png"
        height: buttonSize; width: buttonSize
        onClicked: toolbar.button3Clicked(); // Event function callback
        anchors.left: btn_edit.right
        anchors.margins: btnMargin
        anchors.top: parent.top
        anchors.topMargin: btnMargin
    }
}
